Skip Headers
Oracle® OPatch User's Guide
Release 12.1 for Windows and UNIX

Part Number E39376-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

B OPatchauto Syntax and Commands

This appendix provides a comprehensive listing and description of all OPatchauto commands.

IMPORTANT:

OPatchauto commands must be run from the GI Home.

B.1 OPatchauto Commands

The OPatchauto commands are run from the GI Home out of the standard OPatch directory. In the following generic example, an OPatchauto command is run from a GI Home.

$GI_HOME/OPatch/opatchauto apply <PATH_TO_PATCH_DIRECTORY>

where <PATH_TO_PATCH_DIRECTORY> is the full path to local staging area where you have downloaded your patches.

OPatchauto consists of five primary command:

OPatchauto Help

You can view online help for any command by specifying the -help or -h option.

For example:

> opatchauto -help
> opatchauto -h
> opatchauto apply -help
> opatchauto resume -help
> opatchauto rollback -help
> opatchauto version -help

B.1.1 apply

Apply a System Patch to a GI/RAC/DB home. User specified the patch location or the current directory will be taken as the patch location.

Important: OPatchauto must be run from the GI Home as a root user.

Syntax

<GI_HOME>/OPatch/opatchauto apply
                            [-analyze]
                            [-database <database names> ]
                            [-generateSteps]
                            [-invPtrLoc <Path to oraInst.loc> ]
                            [-jre <LOC> ]
                            [-norestart ]
                            [-nonrolling ]
                            [-ocmrf <OCM response file location> ]
                            [-oh <ORACLE_HOME> ]
                            [ <Patch Location> ]

Options

The following table describes the options available for the apply command.

Table B-1 apply Command Options

Option Description

-analyze

The analyze option runs all the required prerequisite checks to confirm the patchability of the system without actually patching or affecting the system in any way.

-database

The database option is used to specify the RDBMS home(s) to be patched. This option takes a comma-separated list of Oracle database names as input.

-generateSteps

The generate option creates the manual steps for an apply session. OPatchauto performs these steps to apply the patch.

-invPtrLoc

The invPtrLoc option is used to locate the Central Inventory Pointer File (oraInst.loc). Input for this option is the path to the oraInst.loc file.

-norestart

The norestart option instructs OPatchauto not to restart the Grid Infrastructure stack after patching.

-nonrolling

The nonrolling option instructs OPatchauto to run the patching session run in 'nonrolling' mode. Before the patching session can start, the following prerequisites must be met:

  • The stack on the local node must be running

  • All remote nodes must be down.

-ocmrf

The ocmrf option specifies the absolute path to the Oracle Configuration Manager (OCM) response file. It is required if the target GI/RAC/DB home does not have OCM installed and configured.

-oh

The oh option specifies the GI/RAC/DB home to be patched. This can be a RAC Home or Grid Infrastructure Home.

<patch location>

The explicit path to the location of the patch. If the patch location is not specified, then the current directory is taken as the patch location.


Example B-1 Patch a GI Home and all RAC Homes

<GI_HOME>/OPatch/opatchauto apply

Example B-2 Patch Databases Running from RAC Homes Only

<RAC_HOME>/OPatch/opatchauto apply -database db1,db2...dbn

Example B-3 Patch Software-only Installations

<RAC_HOME>/OPatch/opatchauto apply -oh <RAC_HOME>
OR
<GI_HOME>/OPatch/opatchauto apply -oh <GI_HOME>

Table B-2 OPatchauto Command Examples

Command Action Comment

<GI_HOME>/OPatch/opatchauto apply <SYSTEM_PATCH_TOP_DIR> <GI_HOME>

Patch both GI home and all RAC homes.

OPatchauto must run from Grid Infrastructure home directory (GI HOME).

<GI_HOME>/OPatch/opatchauto apply <SYSTEM_PATCH_TOP_DIR> -oh <GI_HOME>

Patch GI home only.

Local stack can be down. If local stack is down, opatchauto should continue patching.

opatchauto must run from the GI HOME.

<RAC_HOME>/OPatch/opatchauto apply <SYSTEM_PATCH_TOP_DIR> -database db1,db2

Patch database db1 and db2 and their associated GI/RAC/DB homes.

db1 and db2 can run from the same or different GI/RAC/DB homes.

Stack has to be up. If not, error out.

If there is another db-99 running from the same GI/RAC/DB home as db1, opatchauto will error out in both –silent and non-silent mode telling users that db-99 will get impacted. Users have to specify all databases or use the –oh option.

opatchauo must run from any of the RAC homes being patched.

<RAC_HOME>/OPatch/opatchauto apply <SYSTEM_PATCH_TOP_DIR> –oh <RAC_HOME>

Patch all targets running out from the given RAC home.

opatchauto must run from the <RAC_HOME> being patched.

If there are many RAC homes to patch, just repeat this command many times.

Use the –oh option to patch software-only installed homes or RAC homes where database instances are not created (or created by not registered with OCR).


Notes:

If opatchauto apply is run and encounters an individual patch within a patch set that cannot be installed, that patch will be skipped and OPatchauto will continue with the installation of the next patch in the sequence.

If opatchauto apply is run and encounters an individual patch that is identical (same patch ID and Unique Patch Identifier (UPI)) to a patch already installed in the GI/RAC/DB home, OPatchauto perform the following based on specific patch conditions:

  • If the individual patch was created later than the GI/RAC/DB home patch, OPatchauto installs the individual patch.

  • If the individual patch's creation date is the same as the GI/RAC/DB home patch, OPatchauto will skip installing the individual patch.

  • If the individual patch was created before the GI/RAC/DB home patch, an error will be generated.

This analyze option simulates an opatchauto apply session by running all prerequisite checks, when possible, without making changes to the system (either bits or configurations). Because the analyze command does not modify the system, it will perform the following checks:

  • Run SQL sync in analyze mode.

  • Validate all pre and post processing steps making sure the command is present and executable.

B.1.2 resume

Resume the last OPatchauto session. Currently, it this command can only be used for resuming from Reboot Patching.

Important: OPatchauto must be run from the GI Home as a root user.

Syntax

<GI_HOME>/OPatch/opatchauto resume [-invPtrLoc <Path to oraInst.loc>]
               [-jre <LOC>]
               [-oh <ORACLE_HOME>]
               [-reboot]

Options

The following table describes the options available for the resume command.

Table B-3 resume Command Options

Option Description

-invPtrLoc

The invPtrLoc option is used to locate the Central Inventory Pointer File (oraInst.loc). Input for this option is the path to the oraInst.loc file.

-jre

This jre option instsructs OPatchauto to use the JRE (java) from the specified location instead of the default location under GI/RAC/DB home.

-oh

The oh option specifies the GI/RAC/DB home to work on. This takes precedence over the environment variable ORACLE_HOME.

-reboot

This option tells opatchauto to resume from the previous halted reboot patching session.


B.1.3 rollback

Roll back the applied System Patch from a GI/RAC/DB home. You must specify the patch location or the current directory will be used as the patch location.

Important: OPatchauto must be run from the GI Home as a root user.

Syntax

<GI_HOME>/OPatch/opatchauto rollback
                            [-analyze]
                            [-database <database names> ]
                            [-generateSteps]
                            [-invPtrLoc <Path to oraInst.loc> ]
                            [-jre <LOC> ]
                            [-norestart ]
                            [-nonrolling ]
                            [-oh <ORACLE_HOME> ]
                            [ <Patch Location> ]

Options

The following table describes the options available for the rollback command.

Table B-4 rollback Command Options

Option Description

-analyze

This option runs all the required prerequisite checks to confirm the patchability of the system without actually applying the patch or affecting the system in any way.

-database

The database option is used to specify the RDBMS home(s) to be patched. This option takes a comma-separated list of Oracle database names as input.

-generateSteps

Generate the manual steps that OPatchatuo will perform during the rollback session.

-invPtrLoc

The invPtrLoc option is used to locate the Central Inventory Pointer File (oraInst.loc). Input for this option is the path to the oraInst.loc file.

-jre

This jre option instsructs OPatchauto to use the JRE (java) from the specified location instead of the default location under GI/RAC/DB home.

-norestart

The norestart option instructs OPatchauto not to restart the Grid Infrastructure stack after patching.

-nonrolling

The nonrolling option instructs OPatchauto to run the patching session run in 'nonrolling' mode. Before the patching session can start, the following prerequisites must be met:

  • The stack on the local node must be running

  • All remote nodes must be down.

-oh

The oh option specifies the GI/RAC/DB home to work on. The GI/RAC/DB home specified takes precedence over the environment variable ORACLE_HOME.

<patch location>

The explicit path to the location of the patch. If the patch location is not specified, then the current directory is taken as the patch location.


Example B-4 To roll back a patch on the GI Home and all RAC Homes

<GI_HOME>/OPatch/opatchauto rollback

Example B-5 To roll back a patch on databases running from RAC Homes only

<RAC_HOME>/OPatch/opatchauto rollback -database db1,db2...dbn

Example B-6 To roll back a patch from a software-only installation

<RAC_HOME>/OPatch/opatchauto rollback -oh <RAC_HOME>
OR
<GI_HOME>/OPatch/opatchauto rollback -oh <GI_HOME>

B.1.4 version

Print the version of the OPatch utility, dependent OPlan version, and the osysmodel version.

Important: OPatchauto must be run from the GI Home as a root user.

Syntax

<GI_HOME>/OPatch/opatchauto version [-invPtrLoc <Path to oraInst.loc>]
               [-jre <LOC>]
               [-oh <ORACLE_HOME>]
               [-oui_loc <Custom OUI Location>
               [-help] [-h]

Options

The following table describes the options available for the version command.

Table B-5 version Command Options

Option Description

-invPtrLoc

The invPtrLoc option is used to locate the Central Inventory Pointer File (oraInst.loc). Input for this option is the path to the oraInst.loc file.

-jre

This jre option instsructs OPatchauto to use the JRE (java) from the specified location instead of the default location under GI/RAC/DB home.

-oh

The oh option specifies the GI/RAC/DB home to work on. This takes precedence over the environment variable ORACLE_HOME.

-oui_loc

The oui_loc option displays the custom OUI location from which OPatch runs.